import postApi from '../../utils/http/api'
import store from '../store/store'
import postApiNewUnLogged from '../../utils/http/api-new-unlogged'

export default {
  //30.12发送验证码
  getAuthCode(mobile) {
    return postApi({
      actionCode: '100200',
      method: 'getAutoCode',
      requestData: {
        mobile,
        'type': 2,
      },
    })
  },
  login(mobile, authCode) {
    let apiPath = store.getters.hsApiPath;
    return postApiNewUnLogged({
      actionCode: 'zhiye-user',
      path: `/user/${apiPath}/loginByPhone`,
      requestData: {
        mobile,
        code: authCode,
      },
    })
  },
  loginByWx(wxInfo) {
    return postApiNewUnLogged({
      actionCode: 'zhiye-mobile',
      path: '/zylogin/loginByWx',
      requestData: {
        wxInfo,
      },
    })
  },
  loginBySign(sign) {
    return postApiNewUnLogged({
      actionCode: 'zhiye-user',
      path: `/enterprise/hftuser/login`,
      requestData: {
        sign: sign,
      },
    })
  },
  getUserInfo () {
    return postApi({
      actionCode: '100500',
      method: 'getUserInfo',
      requestData: {},
    })
  },

}
